// releasePage/pages/homePageInfo/deviceSupport/deviceSupport.js
const app = getApp();
Page({
    /**
     * 页面的初始数据
     */
    data: {
        device: [
            {
                value: 'NFC钱包',
                checked: 'true',
            },
            {
                value: 'BOM测试',
            },
            {
                value: 'NFC云闪付',
            },
            {
                value: '自助查票机',
            },
        ],
        deviceSupportArr: ['NFC钱包'],
        deviceSupport: '',
        ipxBottom: 0,
    },

    /**
      生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        if (app.globalData.isIpx) {
            this.setData({
                ipxBottom: 34,
            });
        }
    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {},
    checkboxChange(e) {
        this.setData({
            deviceSupportArr: e.detail.value,
        });
    },
    backTap(e) {
        if (!this.data.deviceSupportArr.length) return;
        let pages = getCurrentPages();
        let prevPage = pages[pages.length - 2];
        prevPage.setData({
            deviceSupport: this.data.deviceSupportArr.join('/'),
        });
        wx.navigateBack({
            delta: 1, // 返回上一级页面。
        });
    },
});
